import request from '@/utils/request'

// 搜索table
export const getData = (data: object) => {
    return request({
        url: '/meta/tInfoSjy/list',
        method: 'post',
        data
    })
};

//添加数据源提交表单
export const submitData = (data: object) => {
    return request({
        url: '/meta/tInfoSjy/add',
        method: 'post',
        data
    })
};

//数据源修改、编辑提交表单
export const submitFormApi = (data: object) => {
    return request({
        url: '/meta/tInfoSjy/edit',
        method: 'post',
        data
    })
};

//删除
export const remove = (ids: string) => {
    const data = { ids }
    return request({
        url: '/meta/tInfoSjy/remove',
        method: 'post',
        data
    })
};

//重置
export const reset = (id: string, yhm: string, fwmm: string) => {
    const data = { id, yhm, fwmm }
    return request({
        url: '/meta/tInfoSjy/resetPwd',
        method: 'post',
        data
    })
};

//启用
export const enable = (id: string, type: string, lx: string) => {
    const data = { id, type, lx }
    return request({
        url: '/meta/tInfoSjy/changeStatus',
        method: 'post',
        data
    })
};

//导出数据源excel
export const exportExcel = () => {
    return request({
        url: '/meta/tInfoSjy/export',
        method: 'post',
    })
};


//验证
export const verifyApi = (id: string) => {
    return request({
        url: `/meta/tInfoSjy/testSjy?id=${id}`,
        method: 'post',
    })
};

//树形图
export const getTreeDataApi = (lxmc: string) => {
    const params = { lxmc }
    return request({
        url: '/meta/sjylx/treeData',
        method: 'get',
        params
    })
};

export const loginSSO = () => {
    return request({
        url: '/loginSSO?userId=4202&token=8b9e6e47-d5bf-4699-99c3-d3209333992a',
        method: 'get',
    })
};

export const reportApi = () => {
    return request({
        url: '/report/resourcefl',
        method: 'get',
    })
};

export const reportTypeApi = () => {
    return request({
        url: '/resource/jbxxb/statistcal/resourceMenu',
        method: 'get',
    })
};